<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/user/userBase.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false,split:false">
	    	<form id="query-form" class="search_form clearfix">
	            
				<dl>
					<dt>昵称：</dt>
					<dd>
						<input name="nick" id="nick" type="text" class="txt" maxlength="16"/>
					</dd>
				</dl>
				<dl>
					<dt>帐号：</dt>
					<dd>
						<input name="searchMore" id="searchMore" type="text" class="txt" maxlength="32"/>
					</dd>
				</dl>
				
				<dl>
	            	<dt>注册时间：从</dt>
	                <dd>
		                <input name="startAtStr" id="startAtStr" type="text" class="txt easyui-datetimebox" maxlength="19"/> 到 
		                <input name="endAtStr" id="endAtStr" type="text" class="txt easyui-datetimebox" maxlength="19"/>
	                </dd>
	            </dl>
				<dl>
					<dt>身份认证：</dt>
					<dd>
						<select name="hasIdentityAuth" id="hasIdentityAuth" class="txt grid-8">
							<option value="">请选择</option>
							<option value="1">已认证</option>
							<option value="2">未认证</option>
						</select>
					</dd>
				</dl>
				
				<p class="cl"></p>
				<dl>
					<dt>荣誉值：</dt>
					<dd>
						<input name="honorValueStart" id="honorValueStart" type="text" class="txt" maxlength="16" oninput="intBlur(this)" onpropertychange="intBlur(this)"/>
						--
						<input name="honorValueEnd" id="honorValueEnd" type="text" class="txt" maxlength="16" oninput="intBlur(this)" onpropertychange="intBlur(this)"/>
					</dd>
				</dl>
				<dl>
					<dt>排序：</dt>
					<dd>
						<select name="sortField" id="sortField" class="txt grid-8">
							<option value="">请选择</option>
							<option value="honorValue">荣誉值</option>
							<option value="quanValue">圈币</option>
							<option value="money">余额</option>
						</select>
					</dd>
				</dl>
				<dl>
					<dt>顺序：</dt>
					<dd>
						<select name="sortDirection" id="sortDirection" class="txt grid-8">
							<option value="DESC" selected="selected">高到低</option>
							<option value="ASC">低到高</option>
						</select>
					</dd>
				</dl>
				<p class="cl"></p>
				<dl>
					<dt>圈币：</dt>
					<dd>
						<input name="quanValueStart" id="quanValueStart" type="text" class="txt" maxlength="16" oninput="intBlur(this)" onpropertychange="intBlur(this)"/>
						--
						<input name="quanValueEnd" id="quanValueEnd" type="text" class="txt" maxlength="16" oninput="intBlur(this)" onpropertychange="intBlur(this)"/>
					</dd>
				</dl>
				<dl>
					<dt>余额：</dt>
					<dd>
						<input name="moneyStart" id="moneyStart" type="text" class="txt" maxlength="16" oninput="intBlur(this)" onpropertychange="intBlur(this)"/>
						--
						<input name="moneyEnd" id="moneyEnd" type="text" class="txt" maxlength="16" oninput="intBlur(this)" onpropertychange="intBlur(this)"/>
					</dd>
				</dl>
	            <p class="search_form_btn">
	            	<input type="button" value="搜索" class="icon_serach" onclick="admin.userBase.query()" />
	            </p>
	            <dl></dl>
	            <p class="search_form_btn">
	            	<input type="button" value="导出excel" class="icon_serach" onclick="admin.userBase.export2Excel()" />
	            </p>
	        </form>
	  	</div>
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/user/base/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'nick',width:100,align:'center'">昵称</th>
						<th data-options="field:'sexDesc',width:50,align:'center'">性别</th>
						<th data-options="field:'communityName',width:100,align:'center'">所属社区</th>
						<th data-options="field:'typeDesc',width:100,align:'center' ">帐号类型</th>
						<th data-options="field:'userIdentity',width:150,align:'center' ">帐号</th>
						<th data-options="field:'talentCount',width:70,align:'center' ">发帖数</th>
						<th data-options="field:'totalCommentCount',width:70,align:'center' ">用户评论数</th>
						<th data-options="field:'totalPraiseCount',width:70,align:'center' ">点赞数</th>
						<th data-options="field:'honorValue',width:100,align:'center' ">荣誉值</th>
						<th data-options="field:'honorLevel',width:80,align:'center' ">荣誉等级</th>
						<th data-options="field:'quanValue',width:100,align:'center' ">圈币</th>
						<th data-options="field:'money',width:100,align:'center' ">余额</th>
						<th data-options="field:'couponCount',width:70,align:'center' ">代金卷数量</th>
						<th data-options="field:'orderCount',width:70,align:'center' ">订单数量</th>
						<th data-options="field:'strNewAt',width:100,align:'center'">注册时间</th>
						<th data-options="field:'interests',width:100,align:'center' ">兴趣</th>
						<th data-options="field:'hometown',width:100,align:'center',formatter:formatHometown">家乡</th>
						<th data-options="field:'delicacys',width:100,align:'center' ">美食</th>
						<th data-options="field:'profession',width:100,align:'center',formatter:formatProfession">行业</th>
						<th data-options="field:'graduateSchool',width:100,align:'center'">学校</th>
						<th data-options="field:'entertainment',width:100,align:'center' ">娱乐</th>
						<th data-options="field:'isOfficial',width:80,align:'center',formatter:formatIsOfficial ">是否官方用户</th>
						<th data-options="field:'isOnlineService',width:80,align:'center',formatter:formatIsOnlineService ">是否在线客服</th>
						<th data-options="field:'hasIdentityAuth',width:80,align:'center',formatter:formatHasIdentityAuth ">身份认证</th>
			            <th data-options="field:'id',align:'center',width:250,formatter:formatOperation">操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>

	<script>
	function formatIsOnlineService(value,row,index) {
		var l_html = '';
		if (value==1) {
			l_html = '在线客服';
		}else{
			l_html = '否';
		}
		return l_html;
	}
	function formatIsOfficial(value,row,index) {
		var l_html = '';
		if (value==1) {
			l_html = '官方';
		}else{
			l_html = '否';
		}
		return l_html;
	}
	function formatHasIdentityAuth(value,row,index) {
		var l_html = '未认证';
		if (value==1) {
			l_html = '已认证';
		}
		return l_html;
	}
	function formatOperation(value,row,index) {
		var isOfficial = row.isOfficial;//1:官方；2:非官方
		var isOnlineService = row.isOnlineService;//1:在线客服；2:否
		var l_html = '';
		l_html += '<a href="javascript:;" class="table_link" onclick="admin.userBase.detail('+row.id+')">用户详情</a>';
		l_html += '|<a href="javascript:;" class="table_link" onclick="admin.userBase.auth('+row.id+')">身份认证</a>';

		l_html += '|<a href="javascript:;" class="table_link" onclick="admin.userBase.authCommunity('+row.id+')">社区住户认证</a>';
		/*
		if(isOfficial=="1"){
			l_html += '|<a href="javascript:;" class="table_link" onclick="admin.userBase.setNotOfficial('+row.id+')">取消官方</a>';
		}else{
			l_html += '|<a href="javascript:;" class="table_link" onclick="admin.userBase.setIsOfficial('+row.id+')">设为官方</a>';
		}*/
		/*
		if(isOnlineService=="1"){
			l_html += '|<a href="javascript:;" class="table_link" onclick="admin.userBase.setNotOnlineService('+row.id+')">取消在线客服</a>';
		}else{
			l_html += '|<a href="javascript:;" class="table_link" onclick="admin.userBase.setIsOnlineService('+row.id+')">设为在线客服</a>';
		}
		*/
		return l_html;
	}
	function formatHometown(value,row,index) {
		switch(value){
			case "1":return "北京市";
			case "2":return "天津市";
			case "3":return "上海市";
			case "4":return "重庆市";
			case "5":return "河北省";
			case "6":return "河南省";
			case "7":return "云南省";
			case "8":return "辽宁省";
			case "9":return "黑龙江省";
			case "10":return "湖南省";
			case "11":return "安徽省";
			case "12":return "山东省";
			case "13":return "新疆维吾尔族自治区";
			case "14":return "江苏省";
			case "15":return "浙江省";
			case "16":return "江西省";
			case "17":return "湖北省";
			case "18":return "广西壮族自治区";
			case "19":return "甘肃省";
			case "20":return "山西省";
			case "21":return "内蒙古自治区";
			case "22":return "陕西省";
			case "23":return "吉林省";
			case "25":return "福建省";
			case "26":return "贵州省";
			case "27":return "广东省";
			case "28":return "青海省";
			case "29":return "西藏自治区";
			case "30":return "四川省";
			case "31":return "宁夏回族自治区";
			case "32":return "海南省";
			case "33":return "台湾省";
			case "34":return "香港特别行政区";
			case "35":return "澳门特别行政区";
		}
		
	}
	
	function formatProfession(value,row,index) {
		switch(value){
			case "1":return "农、林、牧、渔业";
			case "2":return "采矿业";
			case "3":return "制造业";
			case "4":return "电力、热力、燃气及水生产和供应业";
			case "5":return "建筑业";
			case "6":return "批发和零售业";
			case "7":return "交通运输、仓储和邮政业";
			case "8":return "住宿和餐饮业";
			case "9":return "信息传输、软件和信息技术服务业";
			case "10":return "金融业";
			case "11":return "房地产业";
			case "12":return "租赁和商务服务业";
			case "13":return "科学研究和技术服务业";
			case "14":return "水利、环境和公共设施管理业";
			case "15":return "居民服务、修理和其他服务业";
			case "16":return "教育";
			case "17":return "公共管理、社会保障和社会组织";
			case "18":return "文化、体育和娱乐业";
			case "19":return "国际组织";
		}
	}
	function intBlur(oInput){
		var s=oInput.value;
		var num=parseInt(oInput.value);
		if(isNaN(num)||num<0) num=0;
		if(s!=num) oInput.value=num;
	}
	
	
	</script>
  </body>
</html>
